#!/env/bin/python
#Author:tanqing
# -*- coding: utf-8 -*-
# @Time        : 2021/1/4 16:29

# 3. 配置⽂件格式转换
# 有⼀个配置⽂件test.ini内容如下，将其转换成json格式⽂件

from configparser import ConfigParser
ini=ConfigParser()
ini.read('mysql.ini')
j={ section:[{option:value} for option,value in ini.items(section)]  for section,v in ini.items()}
print(j)
# dict={}
# for section,v in ini.items():
#     dict[section] = []
#     for option,value in ini.items(section):
#         dict[section].append({option:value})
# print(dict)


# 做的不错


